package br.usp.wta;

import java.io.IOException;

import br.usp.language.automata.StateMachine;
import br.usp.wta.inductor.JJ98;
import br.usp.wta.inductor.PrefixSufixGenerator;
import br.usp.wta.validator.GrammarProvider;
import br.usp.wta.validator.GrammarValidator;
import br.usp.wta.validator.IvoneValidator;
import br.usp.wta.validator.JJValidator;

public class Main {
    
    public static String TRAINING = "resources/training/realtraining/all2.txt";

    public static void main(String[] args) throws IOException {

        PrefixSufixGenerator generator = new PrefixSufixGenerator(TRAINING, null);
        generator.generate();
        StateMachine Ap = generator.getPrefixAut();
        StateMachine As = generator.getSufixAut();
        JJ98 jj98 = new JJ98();
        StateMachine Ac = jj98.geraAc(Ap, As);
        
        GrammarValidator validator = new JJValidator(Ac);
        validator.verify();
        System.out.println("Infered by JJ: ");
        validator.printResult();
        System.out.println("");

        validator = new IvoneValidator(GrammarProvider.INFEREDGRAMMAR);
        validator.verify();
        System.out.println("Infered by Ivone: ");
        validator.printResult();
        System.out.println("");

        validator = new IvoneValidator(GrammarProvider.LUFTGRAMMAR);
        validator.verify();
        System.out.println("Luft grammar: ");
        validator.printResult();
        System.out.println("");
    }

}
